@ECHO OFF

@REM ---------------------------------------------------------------------------------------------------

IF EXIST ..\Build\Release\NJQuery.dll GOTO :COPYNJQUERY

ECHO.
ECHO ERROR: You must perform a release build on the NJQuery assembly.
ECHO.
PAUSE

GOTO :EOF

@REM ---------------------------------------------------------------------------------------------------

:COPYNJQUERY

ECHO.
ECHO.
ECHO Copying libraries...
ECHO.

COPY ..\Build\Release\NJQuery*.dll .\Sample.NJQuery\bin\


for /f "tokens=*" %%a in ('DIR /B ..\Resources\NJQuery*') do CALL :COPYRES %%a


for /f "tokens=*" %%a in ('DIR /B ..\Resources\NJQuery\themes\*.') do CALL :COPYTHEME %%a


ECHO.
PAUSE

GOTO :EOF

@REM ---------------------------------------------------------------------------------------------------

:COPYRES

ECHO.
ECHO.
ECHO Copying resources for %1...
ECHO.

IF EXIST ..\Resources\%1\scripts\jquery\*.js COPY ..\Resources\%1\scripts\jquery\*.js .\Sample.NJQuery\scripts\jquery\
IF EXIST ..\Resources\%1\styles\jquery\*.css COPY ..\Resources\%1\styles\jquery\*.css .\Sample.NJQuery\styles\jquery\
IF EXIST ..\Resources\%1\styles\jquery\images\*.png COPY ..\Resources\%1\styles\jquery\images\*.png .\Sample.NJQuery\styles\jquery\images\
IF EXIST ..\Resources\%1\styles\jquery\images\*.gif COPY ..\Resources\%1\styles\jquery\images\*.gif .\Sample.NJQuery\styles\jquery\images\

GOTO :EOF

@REM ---------------------------------------------------------------------------------------------------

:COPYTHEME

ECHO.
ECHO.
ECHO Copying theme %1...
ECHO.

COPY ..\Resources\NJQuery\themes\%1\*.css .\Sample.NJQuery\styles\jquery\
COPY ..\Resources\NJQuery\themes\%1\images\*.png .\Sample.NJQuery\styles\jquery\images\

GOTO :EOF

@REM ---------------------------------------------------------------------------------------------------